<?php

namespace app\admin\model\validate;

use think\Validate;

class ArticleFromCategory extends Validate {
    protected $rule =   [
        'desc' => 'max:64',
        'name' => 'require|max:20',
        'sort' => 'number',
    ];

    protected $message  =   [
        'desc.max' => '描叙不能超过64个字符',
        'name.require' => '标题不能为空',
        'name.max' => '标题不能超过20个字符',
        'sort.number'     => '排序必须是数字',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}